<?php

namespace App\Nova\Repeater;

use Illuminate\Support\Str;
use Laravel\Nova\Fields\File;
use Laravel\Nova\Fields\ID;
use Laravel\Nova\Fields\Repeater\Repeatable;
use Laravel\Nova\Fields\Text;
use Laravel\Nova\Http\Requests\NovaRequest;

class VideoItem extends Repeatable
{
    public static function label(): string
    {
        return '视频';
    }

    public function fields(NovaRequest $request): array
    {
        return [
            ID::hidden()->default(Str::random()),

            Text::make('版本', 'version')->default('高清版')->rules('required'),

            File::make('视频文件', 'path')->prunable()->creationRules('required'),
        ];
    }
}
